<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="css/index.css" type="text/css" rel="stylesheet">
<%
pageContext.setAttribute("path",request.getContextPath());
%>
<link rel="stylesheet" href="${path}/css/favorite.css">
<script type="text/javascript" src="${path}/js/jquery-1.8.3.js"></script>
</head>
<body>
		<div class="jdm-toolbar-wrap J-wrap" style="height: auto;">                
			<div class="jdm-toolbar J-toolbar">                    
				 <div class="jdm-toolbar-panels J-panel">                                             
				</div>                                       
				<div class="jdm-toolbar-tabs J-tab">  
					<div data-type="bar" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-cart">                                
						<i class="tab-ico"></i><a href="${pageContext.request.contextPath}/Carts?userId=${sessionScope.user.userId}">                              <em class="tab-text">购物车                                
						</em>   </a>                                                 
					</div>   
					<div class="J-trigger jdm-toolbar-tab jdm-tbar-tab-message" data-name="message">
					<i class="tab-ico"></i><a href="${pageContext.request.contextPath}/showFavorite?userId=${sessionScope.user.userId}">                                 
					<em class="tab-text">      收藏夹                               
					</em></a>                                               
				</div>                     
			</div>                     
			<div class="jdm-toolbar-footer">                        
				<div data-type="link" id="#top" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-top">                                
					<a href="#" clstag="h|keycount|cebianlan_h|top">                                
						<i class="tab-ico"></i>                                <em class="tab-text">顶部</em>                                
					</a>                         
				</div>                        
				<div data-type="link" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-feedback">                                 
					<a href="http://surveys.jd.com/index.php?r=survey/index/sid/889711/newtest/Y/lang/zh-Hans" target="_blank" clstag="h|keycount|cebianlan_h|feedback">                                    
						<i class="tab-ico"></i>                                    
						<em class="tab-text">反馈</em>                                
					</a>                        
				</div>                        
			</div>                    
			<div class="jdm-toolbar-mini">                    
			</div>                
		</div>                
		<div id="J-toolbar-load-hook" clstag="h|keycount|cebianlan_h|load"></div>            
	</div>
		<!-----------------------------------------顶部-------------->
		<header id="header">
			<div class="header-box">
				<ul class="header-left">
				</ul>
				<ul class="header-right">
					<li class="denglu"><a href="${pageContext.request.contextPath}/jsp/user/userLogin.jsp">您好，请登录</a> <a href="${pageContext.request.contextPath}/jsp/user/userRegister.jsp"  class="red">免费注册</a></li> 
					<li class="shu"></li>
					<li class="denglu"><a href="#">我的订单</a></li>
					<li class="denglu"><a href="${pageContext.request.contextPath}/showFavorite?userId=${sessionScope.user.userId}">我的收藏夹</a></li>
					<li class="denglu"><a href="${pageContext.request.contextPath}/getUsers?userId=${sessionScope.user.userId}">个人中心</a></li>
					<li class="denglu"><a href="${pageContext.request.contextPath}/jsp/shop/ShopLogin.jsp">卖家中心</a></li>
					<li class="denglu"><a href="${pageContext.request.contextPath}/jsp/login/login.jsp">管理员中心</a></li>
				</ul>
			</div>
		</header>
		<div class="w">
			<div class="logo"><a href="${pageContext.request.contextPath}/index.jsp"><img width="100" height= "80" src="./images/logo.png"></a></div>
			<div class="search">
				<input type="text" value="搜索" class="text" id="textt">
				<button class="button" onclick="find()">搜索</button>
			</div>
			<div class="right">
				<i class="gw-left" style="background:url(./images/jd2015img.png)0 -58px no-repeat;width:24px;height:24px;"></i>
				<i class="gw-right">></i>
				<i class="gw-count">0</i>
				<a href="${pageContext.request.contextPath}/Carts?userId=${sessionScope.user.userId}">我的购物车</a>
				<div class="dorpdown-layer">
					<img src="./images/settleup-nogoods.png">
					购物车中还没有商品，赶紧选购吧！
				</div>
			</div>
			<div class="hotwords">
				<a href="#">海苔</a>
				<a href="#">果冻</a>
				<a href="#">饼干</a>
				<a href="#">锅巴</a>
				<a href="#">可乐</a>
			</div>
		</div>
		
		<div class="clear"></div>
		
<div class="abcsfh" style="height: auto;">
<div id="fav-tab">
   <label class="fav-tab-0">食 品 会<span class="fav-tab-1">收藏夹</span></label>
   <div class="fav-tab-2">
      <a href="#" >食品收藏</a>
   </div>
</div>
<div class="fav-tac">
   <div class="fav-tac-0">
      <span>全部食品</span>
   </div>
</div>
 <div class="div0">
	<c:forEach items="${ShowFavorite}" var="favorite">
	<div class="div0-0">
		<div class="div1">
		 <!-- <ul>
		   <li> -->
		  <a href="${pageContext.request.contextPath}/detail?goodsId=${favorite.goodsId}" class="list_img">
		    <img src="${path}/images/${favorite.goodsPhoto}" alt="">
		  </a> 
		   <a href="#" onclick="goDeleteFavorite(${favorite.favoriteId})" class="a1" title="删除食品">删除</a>
		  <!--  </li>
		 </ul>  --> 
		</div>		
		<div class="div2">
		   <a style="text-align: center;" class="a0" href="">${favorite.goodsName}</a>
		</div>
		<div class="div3">
		   <span>￥</span>
		   <strong>${favorite.goodsPrice}</strong>
		</div>
	</div>
	</c:forEach>	
  </div>
</div>
<div style="height: auto;float: left;margin-left: 160px;">
	<!--***********************************************-->
	<div class="lazy-fn lazy-fn-done" id="lazy-footer">        
		<div id="service-2014">
	<div class="w">
		<dl class="fore1">
			<dt>购物指南</dt>
			<dd>
				<div><a rel="nofollow" target="_blank" href="#">购物流程</a></div>
				<div><a rel="nofollow" target="_blank" href="#">会员介绍</a></div>
				<div><a rel="nofollow" target="_blank" href="#">生活旅行/团购</a></div>
				<div><a rel="nofollow" target="_blank" href="#">常见问题</a></div>
				<div><a rel="nofollow" target="_blank" href="#">大家电</a></div>
				<div><a rel="nofollow" target="_blank" href="#">联系客服</a></div>
			</dd>
		</dl>
		<dl class="fore2">		
			<dt>配送方式</dt>
			<dd>
				<div><a rel="nofollow" target="_blank" href="#">上门自提</a></div>
				<div><a rel="nofollow" target="_blank" href="#">211限时达</a></div>
				<div><a rel="nofollow" target="_blank" href="#">配送服务查询</a></div>
				<div><a rel="nofollow" target="_blank" href="#">配送费收取标准</a></div>
				<div><a target="_blank" href="#">海外配送</a></div>
			</dd>
		</dl>
		<dl class="fore3">
			<dt>支付方式</dt>
			<dd>
				<div><a rel="nofollow" target="_blank" href="#">货到付款</a></div>
				<div><a rel="nofollow" target="_blank" href="#">在线支付</a></div>
				<div><a rel="nofollow" target="_blank" href="#">分期付款</a></div>
				<div><a rel="nofollow" target="_blank" href="#">邮局汇款</a></div>
				<div><a rel="nofollow" target="_blank" href="#">公司转账</a></div>
			</dd>
		</dl>
		<dl class="fore4">		
			<dt>售后服务</dt>
			<dd>
				<div><a rel="nofollow" target="_blank" href="#">售后政策</a></div>
				<div><a rel="nofollow" target="_blank" href="#">价格保护</a></div>
				<div><a rel="nofollow" target="_blank" href="#">退款说明</a></div>
				<div><a rel="nofollow" target="_blank" href="#">返修/退换货</a></div>
				<div><a rel="nofollow" target="_blank" href="#">取消订单</a></div>
			</dd>
		</dl>
		<dl class="fore5">
			<dt>特色服务</dt>
			<dd>		
				<div><a target="_blank" href="#">夺宝岛</a></div>
				<div><a target="_blank" href="#">DIY装机</a></div>
				<div><a rel="nofollow" target="_blank" href="#">延保服务</a></div>
				<div><a rel="nofollow" target="_blank" href="#">京东E卡</a></div>	
				<div><a rel="nofollow" target="_blank" href="#">京东通信</a></div>
				<div><a rel="nofollow" target="_blank" href="#">京东JD+</a></div>
			</dd>
		</dl>
		<div id="coverage">
			<div class="dt">
				京东自营覆盖区县
			</div>
			<div class="dd">
				<p>京东已向全国2423个区县提供自营配送服务，支持货到付款、POS机刷卡和售后上门服务。</p>
				<p class="ar"><a target="_blank" href="http://help.jd.com/user/issue/103-983.html">查看详情&nbsp;&gt;</a></p>
			</div>
		</div>
		<span class="clr"></span>
	</div>
</div>        <div class="w">
	<div id="footer-2014" >
		<div class="links">
			<a rel="nofollow" target="_blank" href="#">关于我们</a>|<a  href="#">联系我们</a>|<a rel="nofollow" target="_blank" href="#">商家入驻</a>|<a rel="nofollow" target="_blank" href="#">营销中心</a>|<a rel="nofollow" target="_blank" href="#">手机京东</a>|<a target="_blank" href="#">友情链接</a>|<a target="_blank" href="#">销售联盟</a>|<a href="#" target="_blank">京东社区</a>|<a href="#" target="_blank">京东公益</a>|<a href="#" target="_blank">English Site</a>|<a href="#" target="_blank">Contact Us</a></div>
		<div class="copyright">
			<a target="_blank" href="#"><img src="images/56a0a994Nf1b662dc.png"> 京公网安备 11000002000088号</a>&nbsp;&nbsp;|&nbsp;&nbsp;京ICP证070359号&nbsp;&nbsp;|&nbsp;&nbsp;<a target="_blank" href="#">互联网药品信息服务资格证编号(京)-经营性-2014-0008</a>&nbsp;&nbsp;|&nbsp;&nbsp;新出发京零&nbsp;字第大120007号<br><a rel="nofollow" href="#" target="_blank">音像制品经营许可证苏宿批005号</a>&nbsp;&nbsp;|&nbsp;&nbsp;出版物经营许可证编号新出发(苏)批字第N-012号&nbsp;&nbsp;|&nbsp;&nbsp;互联网出版许可证编号新出网证(京)字150号<br><a href="#" target="_blank">网络文化经营许可证京网文[2014]2148-348号</a>&nbsp;&nbsp;违法和不良信息举报电话：4006561155&nbsp;&nbsp;Copyright&nbsp;©&nbsp;2004-2016&nbsp;&nbsp;京东JD.com&nbsp;版权所有<br>京东旗下网站：<a target="_blank" href="http://www.360top.com/">360TOP</a>&nbsp;&nbsp;<a href="#" target="_blank">拍拍网</a>&nbsp;&nbsp;<a href="#" target="_blank">网银在线</a></div>
		
		<div class="authentication">
			<a rel="nofollow" target="_blank" href="#">
				<img width="103" height="32" alt="经营性网站备案中心" src="images/54b8871eNa9a7067e.png" class="err-product">
			</a>
			
			<a rel="nofollow" target="_blank" id="urlknet" tabindex="-1" href="#">
				<img border="true" width="103" height="32" onclick="CNNIC_change('urlknet')" oncontextmenu="return false;" name="CNNIC_seal" alt="可信网站" src="images/54b8872dNe37a9860.png" class="err-product">
			</a>
			<a rel="nofollow" target="_blank" href="#">
				<img width="103" height="32" alt="网络警察" src="images/56a89b8fNfbaade9a.jpg" class="err-product">
			</a>
			<a rel="nofollow" target="_blank" href="#">
				<img width="103" height="32" src="images/54b8875fNad1e0c4c.png" class="err-product">
			</a>
			<a target="_blank" href="#"><img width="103" height="32" src="images/5698dc03N23f2e3b8.jpg"></a>
			<a target="_blank" href="#"><img width="103" height="32" src="images/5698dc16Nb2ab99df.jpg"></a>
		</div>
	  </div>
    </div>
  </div>
	</div>
</div>
</body>
 <script>
    $(document).ready(function(e) {
        $(".div1").hover(
            function(){
                $(this).find(".a1").stop(true,true).show();
            },function(){
                $(this).find(".a1").stop(true,true).hide();
            });
    });
    
    function goDeleteFavorite(favoriteId){
    	if(confirm("确认删除?")){
    		$.ajax({//进行提交
    			type : "post",//提交方式
    			url : "${pageContext.request.contextPath}/deletefavorite",//提交路径
    			async : true,//是否异步
    			dataType : 'json',//数据格式（不进行跨越json，跨域使用jsonp），
    			data : { //参数
    				favoriteId : favoriteId,
    			},
    			success : function(data) {//执行成功后调用的方法
    					if(data[0] == 1){
    						
    						window.location.reload();
    					}else{
    						alert("删除失败");
    					}	
    				},
    			error : function(err) {//执行失败后的失败信息的显示
    				console.log(err);
    			}
    		});
    	} 
     }
    
    function find(){
    	window.location.href='http://localhost:8080/jsp/user/findGoods.jsp';
    } 
</script>
</html>






